// 版权归 瞄你个汪 所有。使用本代码应遵守相关法律法规和Apache 2.0开源许可要求。
package top.geeke.database.seed;

import top.geeke.constants.AppConstPool;
import top.geeke.entity.SysDictData;
import top.geeke.toolkit.supertable.seed.SuperSeedData;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系统字典数据表种子数据
 * </p>
 *
 * @author 瞄你个汪
 * @since 2024/5/26 8:13
 */
public class SysDictDataSeedData implements SuperSeedData<SysDictData> {
    @Override
    public List<SysDictData> getSeedData() {
        return new ArrayList<SysDictData>(){{
            add(newInstance(1300000000101L, 1300000000101L, "输入框", "Input", true, 100, "输入框", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000102L, 1300000000101L, "外键", "fk", true, 101, "外键", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000103L, 1300000000101L, "时间选择", "DatePicker", true, 102, "时间选择", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000104L, 1300000000101L, "选择器", "Select", true, 103, "选择器", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000105L, 1300000000101L, "数字输入框", "InputNumber", true, 104, "数字输入框", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000106L, 1300000000101L, "文本域", "InputTextArea", true, 105, "文本域", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000107L, 1300000000101L, "上传", "Upload", true, 106, "上传", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000108L, 1300000000101L, "树选择", "ApiTreeSelect", true, 107, "树选择", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000109L, 1300000000101L, "开关", "Switch", true, 108, "开关", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000110L, 1300000000101L, "常量选择器", "ConstSelector", true, 109, "常量选择器", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000111L, 1300000000101L, "枚举选择器", "EnumSelector", true, 110, "枚举选择器", AppConstPool.PRIMARY_ID));

            // TODO 其他字典数据
        }};
    }

    public SysDictData newInstance(Long id, Long typeId, String value, String code, boolean isSystem, int orderNo, String remark, Long tenantId) {
        SysDictData data = new SysDictData();

        data.setId(id);
        data.setTypeId(typeId);
        data.setValue(value);
        data.setCode(code);
        data.setSystem(isSystem);
        data.setOrderNo(orderNo);
        data.setRemark(remark);
        data.setTenantId(tenantId);

        return data;
    }
}
